#!/bin/bash
echo "计算 $1 目录的空间占用率"

read size avail< <(df|grep -v "Filesystem"|awk '{print $6,$2,$4}'|grep "$1 "|awk '{print $2,$3}')
echo $size $avail
now=$(date '+%Y-%m-%d %H:%M:%S')

used=$(echo "scale=4; 100 -($avail / $size) * 100" | bc)

echo $now
echo "Disk Space Used of $1: $used %"



